package com.freewater.springboot.demo.aop.advice.before;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class PersonAspect {

    @Pointcut("execution(* com.freewater.springboot.demo.aop.advice.before.PersonService.*(..))")
    public void allMethod() {

    }

    @Before(value = "allMethod() && args(name,age)", argNames = "joinPoint,age,name")
    public void beforeAdvice(JoinPoint joinPoint, int age, String name) {
        System.out.println("params age: " + age);
        System.out.println("params name: " + name);
    }

}
